#ifndef RECTEDGE_HPP
#define RECTEDGE_HPP

#include "meshTypes_fwd.hpp"
#include "rectMesh.hpp"
#include "structEdgeBase.hpp"
#include "rectNormalsType.hpp"

namespace hms {

template<>
class EdgeTraits<RectEdge> : public StructEdgeTraits {
public:
	using MeshType     = RectMesh;
	// using NormalVector = Eigen::DenseBase<RectNormalsType>::ColXpr;
	using NormalVector = Vector2s;
};

class RectEdge : public StructEdgeBase<RectEdge>
{
public:
	using Traits = EdgeTraits<RectEdge>;
	using NormalVector = Traits::NormalVector;

private:

	RectEdge( const RectMesh&, Index );
	
	auto normalImp      () const -> NormalVector;
	auto lengthImp      () const -> scalar;
	auto midpointImp    () const -> Vector2s;
	auto intersectionImp() const -> Vector2s;
	
	friend EdgeBase;
	friend StructMeshBase<RectMesh>;
};

}

#endif